var id = 1
var base = require('../../utils/base.js')
var member_id = base.getMemberData().member_id
var token = base.getMemberData().token
var member_data = base.getMemberData().member_data
var nickname = ''
Page({
  data:{
    clockData:[]
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
    id = options.id
    this.loadData()
  },
 loadData:function(){
  var that = this
  base.getJson('JamyoClock/jamyoClockDetail',{id:id},function(data){
                     console.log(data)
                     data.clock.created_at = base.timeago(data.clock.created_at)
                     that.setData({
                       clockData:data.clock
                     })
                     nickname = data.clock.member.nickname
    })
 },
 toIndex:function(){
   wx.switchTab({
     url: 'index'
   })
 },
 //设置分享
  onShareAppMessage: function () {
    return {
      title: '来JAMYO舞蹈打卡咯',
      desc: '你也一起来JAMYO舞蹈小程序打卡吗？',
      path: '/pages/index/detail?id='+id
    }
  }

})